package com.lm56.web.waybill.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * Created by Kelvin Yeung on 2016/11/3.
 */
public class Waybill {


   public static  final int STATUS_NEW = 0;//新增
    public static final int STATUS_COLLECTED=1; //口已揽件
    public static final int STATUS_RECIEVED=2; //口已收货
    public static final int STATUS_PENDING=3;  //口待处理  不是已中转或已签收的都算待处理
    public static final int STATUS_TRANSSHIPPED=4;   //口已中转
    public static final int STATUS_SIGN=5;   //口已签收


    public static final int PAY_TYPE_CARRIAGE_PREPAID = 1;//1.现付，2提付，3回单付  carriage prepaid freight collect  Pay the receipt“现付”，“回单付”，“月结”，monthly “提付”，“混合支付”mixed paym
    public static final int PAY_TYPE_FREIGHT_COLLECT=2;//提付
    public static final int PAY_TYPE_PAY_THE_RECEIPT=3;//回单付
    public static final int PAY_TYPE_MONTHLY=4;//月结
    public static final int PAY_TYPE_MIXED=5; //混合支付

    public static final int ORIGIN_TYPE_SENDER = 0 ;//0 发货人发起的订单;1 公司发起的订单/2中转过来的订单
    public static final int ORIGIN_TYPE_COMPANY = 1;
    public static final int ORIGIN_TYPE_TRANSFER = 2;

    public static final int TYPE_SELF_SEND = 1;//自寄
    public static final int TYPE_PICK_UP = 2;//上门提货

    public static final int IS_NORMAL=0;
    public static final int IS_RECYCLING = 1;
    public static final int IS_DELETED=2;

    private Long waybillId; //这个waybillId对应 表waybill的Id
    private String waybillNo;
    private Long companyId;
    @NotBlank(message = "公司名称不能为空")
    private String companyName;
    private Long lastCompanyId;
    private String companyAddr;
    @NotBlank(message = "联系电话不能为空")
    private String companyPhoneNo1;
    private String companyPhoneNo2;
    private Integer waybillStatus;
    private Double waybillFee;
    private Integer originType;  //起源类型 0 发货人发起的订单;1 公司发起的订单/2中转过来的订单
    private Integer seqNo;
    private Integer waybillType;
    @NotNull(message = "托运日期不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date sendDate;
    private Long senderId;
    private String senderName;
    private Long startLocationId;
    private String startAddr;
    @NotBlank(message = "发货人电话不能为空")
    private String senderPhoneNo;
    private Long receiverId;
    private String receiverName;
    @NotBlank(message = "收货人电话不能为空")
    private String receiverPhoneNo;
    @NotBlank(message = "收货人地址不能为空")
    private String receiverAddr;  //收货人地址
    private Long endLocationId;
    private String endAddr; //终点站
    private Integer payType;
    private Integer status;
    private String remark;
    @Valid
    private List<GoodsInfo> goods;
    private int isRecycle;





    public Long getWaybillId() {
        return waybillId;
    }

    public void setWaybillId(Long waybillId) {
        this.waybillId = waybillId;
    }

    public String getWaybillNo() {
        return waybillNo;
    }

    public void setWaybillNo(String waybillNo) {
        this.waybillNo = waybillNo;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public Long getLastCompanyId() {
        return lastCompanyId;
    }

    public void setLastCompanyId(Long lastCompanyId) {
        this.lastCompanyId = lastCompanyId;
    }

    public String getCompanyAddr() {
        return companyAddr;
    }

    public void setCompanyAddr(String companyAddr) {
        this.companyAddr = companyAddr;
    }

    public String getCompanyPhoneNo1() {
        return companyPhoneNo1;
    }

    public void setCompanyPhoneNo1(String companyPhoneNo1) {
        this.companyPhoneNo1 = companyPhoneNo1;
    }

    public String getCompanyPhoneNo2() {
        return companyPhoneNo2;
    }

    public void setCompanyPhoneNo2(String companyPhoneNo2) {
        this.companyPhoneNo2 = companyPhoneNo2;
    }

    public Integer getWaybillStatus() {
        return waybillStatus;
    }

    public void setWaybillStatus(Integer waybillStatus) {
        this.waybillStatus = waybillStatus;
    }

    public Double getWaybillFee() {
        return waybillFee;
    }

    public void setWaybillFee(Double waybillFee) {
        this.waybillFee = waybillFee;
    }

    public Integer getOriginType() {
        return originType;
    }

    public void setOriginType(Integer originType) {
        this.originType = originType;
    }

    public Integer getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(Integer seqNo) {
        this.seqNo = seqNo;
    }

    public Integer getWaybillType() {
        return waybillType;
    }

    public void setWaybillType(Integer waybillType) {
        this.waybillType = waybillType;
    }

    public Date getSendDate() {
        return sendDate;
    }

    public void setSendDate(Date sendDate) {
        this.sendDate = sendDate;
    }

    public Long getSenderId() {
        return senderId;
    }

    public void setSenderId(Long senderId) {
        this.senderId = senderId;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public Long getStartLocationId() {
        return startLocationId;
    }

    public void setStartLocationId(Long startLocationId) {
        this.startLocationId = startLocationId;
    }

    public String getStartAddr() {
        return startAddr;
    }

    public void setStartAddr(String startAddr) {
        this.startAddr = startAddr;
    }

    public String getSenderPhoneNo() {
        return senderPhoneNo;
    }

    public void setSenderPhoneNo(String senderPhoneNo) {
        this.senderPhoneNo = senderPhoneNo;
    }

    public Long getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(Long receiverId) {
        this.receiverId = receiverId;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getReceiverPhoneNo() {
        return receiverPhoneNo;
    }

    public void setReceiverPhoneNo(String receiverPhoneNo) {
        this.receiverPhoneNo = receiverPhoneNo;
    }

    public String getReceiverAddr() {
        return receiverAddr;
    }

    public void setReceiverAddr(String receiverAddr) {
        this.receiverAddr = receiverAddr;
    }

    public Long getEndLocationId() {
        return endLocationId;
    }

    public void setEndLocationId(Long endLocationId) {
        this.endLocationId = endLocationId;
    }

    public String getEndAddr() {
        return endAddr;
    }

    public void setEndAddr(String endAddr) {
        this.endAddr = endAddr;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public List<GoodsInfo> getGoods() {
        return goods;
    }

    public void setGoods(List<GoodsInfo> goods) {
        this.goods = goods;
    }


    public int getIsRecycle() {
        return isRecycle;
    }

    public void setIsRecycle(int isRecycle) {
        this.isRecycle = isRecycle;
    }
}
